from flask_restx import Resource, Namespace,fields
from flask import request

api_ns = Namespace('store', description='店铺相关')
 

StoreParams = api_ns.model('StoreParams', {
    'data': fields.String(description='店铺'),
    'code': fields.Integer(description='状态码'),
    'msg': fields.String(description='请求结果')
})

@api_ns.route('/getStore')
@api_ns.doc(params={'id': '必传：店铺id'})
class User(Resource):
    '''Show a single Store item and lets you delete them'''
    @api_ns.marshal_with(StoreParams)
    def get(self):
        '''根据id查找店铺'''
        id = request.args.get("id",type=int) or 0
        return {'code':200,'data':"店铺"+str(id),'msg':'success'}